<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>GeoExt.VectorLegend &mdash; GeoExt v1.0</title>
    <link rel="stylesheet" href="../../../_static/geoext.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '1.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
    <link rel="top" title="GeoExt v1.0" href="../../../index.html" />
    <link rel="up" title="Widgets" href="../widgets.html" />
    <link rel="next" title="GeoExt.WMSLegend" href="WMSLegend.html" />
    <link rel="prev" title="GeoExt.UrlLegend" href="UrlLegend.html" />
    
    
    
    
    

  </head>
  <body>
    <div class="header">
        <div class="wrap">
            <h1 id="logo"><a href="../../../index.html">GeoExt</a></h1>
            <ul id="top-nav">
                <li class="first"><a href="../../../docs.html">Documentation</a></li>
                <li><a href="../../../examples.html">Examples</a></li>
                <li><a href="../../../downloads.html">Download</a></li>
                <li><a href="http://trac.geoext.org/">Development</a></li>
            </ul>
            <div id="searchbox">
                <form class="search" action="../../../search.html" method="get">
                    <input id="searchbox-query" type="text" name="q" size="25" value="Search &hellip;" tabindex="3" onblur="if(this.value=='') this.value='Search &hellip;';" onfocus="if(this.value=='Search &hellip;') this.value='';" />
                    <input id="searchbox-submit" type="image" value="Search" src="../../../_static/img/search_icon_green.png" />
                    <input type="hidden" name="check_keywords" value="yes" />
                    <input type="hidden" name="area" value="default" />
                </form>
            </div>
        </div>
    </div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li><a href="../../../index.html">GeoExt</a> &raquo;</li>
          <li><a href="../../index.html" >API Reference</a> &raquo;</li>
          <li><a href="../widgets.html" accesskey="U">Widgets</a> &raquo;</li>
        <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.VectorLegend</span></tt></a></li>
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../../../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#"><tt class="docutils literal"><span class="pre">GeoExt.VectorLegend</span></tt></a><ul>
<li><a class="reference external" href="#config-options">Config Options</a></li>
<li><a class="reference external" href="#public-methods">Public Methods</a></li>
<li><a class="reference external" href="#events">Events</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="UrlLegend.html"
                                  title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">GeoExt.UrlLegend</span></tt></a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="WMSLegend.html"
                                  title="next chapter"><tt class="docutils literal"><span class="pre">GeoExt.WMSLegend</span></tt></a></p>
        </div>
      </div>


    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="geoext-vectorlegend">
<h1><a title="GeoExt.VectorLegend" class="reference internal" href="#GeoExt.VectorLegend"><tt class="xref docutils literal"><span class="pre">GeoExt.VectorLegend</span></tt></a><a class="headerlink" href="#geoext-vectorlegend" title="Permalink to this headline">¶</a></h1>
<dl class="meta docutils">
<dt>Extends</dt>
<dd><ul class="first last simple">
<li><a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container">Ext.Container</a></li>
<li><a title="GeoExt.LayerLegend" class="reference external" href="LayerLegend.html#GeoExt.LayerLegend"><tt class="xref docutils literal"><span class="pre">GeoExt.LayerLegend</span></tt></a></li>
</ul>
</dd>
<dt>xtype</dt>
<dd><tt class="docutils literal"><span class="pre">gx_vectorlegend</span></tt></dd>
</dl>
<dl class="class">
<dt id="GeoExt.VectorLegend">
<em class="property">class </em><tt class="descclassname">GeoExt.</tt><tt class="descname">VectorLegend</tt><big>(</big><em>config</em><big>)</big><a class="headerlink" href="#GeoExt.VectorLegend" title="Permalink to this definition">¶</a></dt>
<dd>Create a vector legend.</dd></dl>

<div class="section" id="config-options">
<h2>Config Options<a class="headerlink" href="#config-options" title="Permalink to this headline">¶</a></h2>
<p>Configuration properties in addition to
those listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container">Ext.Container</a>.</p>
<dl class="describe">
<dt>
<tt class="descname">bodyBorder</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
Show a border around the legend panel. Default is <tt class="docutils literal"><span class="pre">false</span></tt>.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">clickableSymbol</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
Set cursor style to &#8220;pointer&#8221; for symbolizers.  Register for
the <tt class="docutils literal"><span class="pre">symbolclick</span></tt> event to handle clicks.  Note that click events
are fired regardless of this value.  If <tt class="docutils literal"><span class="pre">false</span></tt>, no cursor style will
be set.  Default is <tt class="docutils literal"><span class="pre">false</span></tt>.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">clickableTitle</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
Set cursor style to &#8220;pointer&#8221; for rule titles.  Register for
the <tt class="docutils literal"><span class="pre">titleclick</span></tt> event to handle clicks.  Note that click events
are fired regardless of this value.  If <tt class="docutils literal"><span class="pre">false</span></tt>, no cursor style will
be set.  Default is <tt class="docutils literal"><span class="pre">false</span></tt>.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">enableDD</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
Allow drag and drop of rules. Default is <tt class="docutils literal"><span class="pre">false</span></tt>.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">labelCls</tt></dt>
<dd><tt class="docutils literal"><span class="pre">String</span></tt>
Optional css class to use for the layer title labels.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">layer</tt></dt>
<dd><tt class="docutils literal"><span class="pre">OpenLayers.Layer.Vector</span></tt>
The layer that this legend will be based on.  One of <tt class="docutils literal"><span class="pre">layer</span></tt>,
<tt class="docutils literal"><span class="pre">rules</span></tt>, or <tt class="docutils literal"><span class="pre">layerRecord</span></tt> must be specified in the config.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">layerRecord</tt></dt>
<dd><a title="GeoExt.data.LayerRecord" class="reference external" href="../data/LayerRecord.html#GeoExt.data.LayerRecord"><tt class="xref docutils literal"><span class="pre">GeoExt.data.LayerRecord</span></tt></a>
The record containing a vector layer that this legend will be based on.
One of <tt class="docutils literal"><span class="pre">layerRecord</span></tt>, <tt class="docutils literal"><span class="pre">layer</span></tt>,  or <tt class="docutils literal"><span class="pre">rules</span></tt> must be specified in
the config.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">legendTitle</tt></dt>
<dd><tt class="docutils literal"><span class="pre">String</span></tt>
Optional title to be displayed instead of the layer title.  If this is
set, the value of <tt class="docutils literal"><span class="pre">showTitle</span></tt> will be ignored (assumed to be true).</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">rules</tt></dt>
<dd><dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">Array(OpenLayers.Rule)</span></tt></dt>
<dd>List of rules.  One of <tt class="docutils literal"><span class="pre">rules</span></tt>, <tt class="docutils literal"><span class="pre">layer</span></tt>, or <tt class="docutils literal"><span class="pre">layerRecord</span></tt> must be
specified in the config.  The <tt class="docutils literal"><span class="pre">symbolType</span></tt> property must also be
provided if only <tt class="docutils literal"><span class="pre">rules</span></tt> are given in the config.</dd>
</dl>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">selectOnClick</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
Set to true if a rule should be selected by clicking on the
symbol or title. Selection will trigger the ruleselected event, and
a click on a selected rule will unselect it and trigger the
<tt class="docutils literal"><span class="pre">ruleunselected</span></tt> event. Default is <tt class="docutils literal"><span class="pre">false</span></tt>.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">showTitle</tt></dt>
<dd><tt class="docutils literal"><span class="pre">Boolean</span></tt>
Whether or not to show the title of a layer. This can be overridden
on the LayerStore record using the hideTitle property.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">symbolType</tt></dt>
<dd><tt class="docutils literal"><span class="pre">String</span></tt>
The symbol type for legend swatches.  Must be one of <tt class="docutils literal"><span class="pre">&quot;Point&quot;</span></tt>,
<tt class="docutils literal"><span class="pre">&quot;Line&quot;</span></tt>, or <tt class="docutils literal"><span class="pre">&quot;Polygon&quot;</span></tt>.  If not provided, the <tt class="docutils literal"><span class="pre">layer</span></tt> or
<tt class="docutils literal"><span class="pre">layerRecord</span></tt> config property must be specified, and the geometry type
of the first feature found on the layer will be used. If a rule does
not have a symbolizer for <tt class="docutils literal"><span class="pre">symbolType</span></tt>, we look at the symbolizers
for the rule, and see if it has a <tt class="docutils literal"><span class="pre">&quot;Point&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;Line&quot;</span></tt> or
<tt class="docutils literal"><span class="pre">&quot;Polygon&quot;</span></tt> symbolizer, which we use for rendering a swatch of the
respective geometry type.</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">untitledPrefix</tt></dt>
<dd><tt class="docutils literal"><span class="pre">String</span></tt>
The prefix to use as a title for rules with no title or
name.  Default is <tt class="docutils literal"><span class="pre">&quot;Untitled</span> <span class="pre">&quot;</span></tt>.  Prefix will be appended with a
number that corresponds to the index of the rule (1 for first rule).</dd></dl>

</div>
<div class="section" id="public-methods">
<h2>Public Methods<a class="headerlink" href="#public-methods" title="Permalink to this headline">¶</a></h2>
<p>Public methods in addition to those
listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container">Ext.Container</a>.</p>
<dl class="method">
<dt id="GeoExt.VectorLegend.setCurrentScaleDenominator">
<tt class="descclassname">VectorLegend.</tt><tt class="descname">setCurrentScaleDenominator</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.VectorLegend.setCurrentScaleDenominator" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameter:</th><td class="field-body"><em>scale</em> &#8211; <tt class="docutils literal"><span class="pre">Number</span></tt> The scale denominator.</td>
</tr>
</tbody>
</table>
<p>Set the current scale denominator.  This will hide entries for any
rules that don&#8217;t apply at the current scale.</p>
</dd></dl>

<dl class="method">
<dt id="GeoExt.VectorLegend.update">
<tt class="descclassname">VectorLegend.</tt><tt class="descname">update</tt><big>(</big><big>)</big><a class="headerlink" href="#GeoExt.VectorLegend.update" title="Permalink to this definition">¶</a></dt>
<dd>Update rule titles and symbolizers.</dd></dl>

</div>
<div class="section" id="events">
<h2>Events<a class="headerlink" href="#events" title="Permalink to this headline">¶</a></h2>
<p>Events in addition to those
listed for <a class="reference external" href="http://dev.sencha.com/deploy/dev/docs/?class=Ext.Container">Ext.Container</a>.</p>
<dl class="describe">
<dt>
<tt class="descname">ruleclick</tt></dt>
<dd><p>Fires when a rule entry is clicked (fired with symbolizer or
title click).</p>
<p>Listener arguments:</p>
<ul class="simple">
<li>comp - <tt class="xref docutils literal"><span class="pre">GeoExt.VectorLegend`</span></tt> This component.</li>
<li>rule - <tt class="docutils literal"><span class="pre">OpenLayers.Rule</span></tt> The rule that was clicked.</li>
</ul>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">rulemoved</tt></dt>
<dd><p>Fires when a rule is moved.</p>
<p>Listener arguments:</p>
<ul class="simple">
<li>comp - <tt class="xref docutils literal"><span class="pre">GeoExt.VectorLegend`</span></tt> This component.</li>
<li>rule - <tt class="docutils literal"><span class="pre">OpenLayers.Rule</span></tt> The rule that was moved.</li>
</ul>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">ruleselected</tt></dt>
<dd><p>Fires when a rule is clicked and <tt class="docutils literal"><span class="pre">selectOnClick</span></tt> is set to
<tt class="docutils literal"><span class="pre">true</span></tt>.</p>
<p>Listener arguments:</p>
<ul class="simple">
<li>comp - <tt class="xref docutils literal"><span class="pre">GeoExt.VectorLegend`</span></tt> This component.</li>
<li>rule - <tt class="docutils literal"><span class="pre">OpenLayers.Rule</span></tt> The rule that was selected.</li>
</ul>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">ruleunselected</tt></dt>
<dd><p>Fires when the selected rule is clicked and <tt class="docutils literal"><span class="pre">selectOnClick</span></tt>
is set to <tt class="docutils literal"><span class="pre">true</span></tt>, or when a rule is unselected by selecting a
different one.</p>
<p>Listener arguments:</p>
<ul class="simple">
<li>comp - <tt class="xref docutils literal"><span class="pre">GeoExt.VectorLegend`</span></tt> This component.</li>
<li>rule - <tt class="docutils literal"><span class="pre">OpenLayers.Rule</span></tt> The rule that was unselected.</li>
</ul>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">symbolclick</tt></dt>
<dd><p>Fires when a rule symbolizer is clicked.</p>
<p>Listener arguments:</p>
<ul class="simple">
<li>comp - <tt class="xref docutils literal"><span class="pre">GeoExt.VectorLegend`</span></tt> This component.</li>
<li>rule - <tt class="docutils literal"><span class="pre">OpenLayers.Rule</span></tt> The rule whose symbol was clicked.</li>
</ul>
</dd></dl>

<dl class="describe">
<dt>
<tt class="descname">titleclick</tt></dt>
<dd><p>Fires when a rule title is clicked.</p>
<p>Listener arguments:</p>
<ul class="simple">
<li>comp - <tt class="xref docutils literal"><span class="pre">GeoExt.VectorLegend`</span></tt> This component.</li>
<li>rule - <tt class="docutils literal"><span class="pre">OpenLayers.Rule</span></tt> The rule whose title was clicked.</li>
</ul>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
            <li class="right" style="margin-right: 10px">
              <a href="../../../genindex.html" title="General Index"
                 accesskey="I">index</a></li>
            <li class="right" >
              <a href="../../../modindex.html" title="Global Module Index"
                 accesskey="M">modules</a> |</li>
            <li class="right" >
              <a href="WMSLegend.html" title="GeoExt.WMSLegend"
                 accesskey="N">next</a> |</li>
            <li class="right" >
              <a href="UrlLegend.html" title="GeoExt.UrlLegend"
                 accesskey="P">previous</a> |</li>
        <li><a href="../../../index.html">GeoExt</a> &raquo;</li>
          <li><a href="../../index.html" >API Reference</a> &raquo;</li>
          <li><a href="../widgets.html" >Widgets</a> &raquo;</li>
        <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.VectorLegend</span></tt></a></li>
      </ul>
    </div>

    <div class="footer">
      &copy; Copyright 2009-2010, GeoExt Community.
    </div>
  </body>
</html>